package com.zhuohao.cloud.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.zhuohao.cloud.entity.User;
import com.zhuohao.cloud.feign.UserFeignClient;

@RestController
public class MovieController {
	
	@Autowired
	private UserFeignClient userFeignClient;
	
	@RequestMapping(method = RequestMethod.GET, value = "/movie/{id}")
	public User findById(@PathVariable Long id) {
		return this.userFeignClient.findById(id);
	}
	
	@RequestMapping(method = RequestMethod.GET, value = "/postuser")
	public User postUser(User user) {
		return this.userFeignClient.postUser(user);
	}
	
	@RequestMapping(method = RequestMethod.GET, value = "/getuser")
	public User getUser(User user) {
		return this.userFeignClient.getUser(user.getId(),user.getName());
	}
}
